package com.ijiangtao.studevtech.study.cxf.demo.day.D20170506;

import javax.xml.ws.Endpoint;

import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class CxfTest{
    public static void main(String[] args){
        
        //第一种发布方式：通过CXF提供的JaxWsServerFactoryBean来发布webservice  
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();  
        factory.setServiceClass(HiDemoImpl.class);  
        factory.setAddress("http://localhost:8080/hi");    
        Server server = factory.create();  
        server.start();  
          
        //第二种方式，通过JAX-WS提供的Endpoint来发布webservice  
        //首先创建webservice服务提供类的实例  
        HiDemoImpl implementor = new HiDemoImpl();  
        String address = "http://localhost:8080/hi";  
        //Endpoint.publish(address, implementor);  
        
    }

}
